package com.itheima.exerciseTest.test30_39;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class Test39 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>(List.of("a", "bb", "ccc", "ccc", "bb", "a"));
        List<String> list2 = new ArrayList<>(List.of("a", "bb", "ccc", "ccc", "bb", "a"));

        list.stream().limit(3).forEach(s -> System.out.print(s + " "));
        System.out.println("\n====================");

        list.stream().skip(3).forEach(s -> System.out.print(s + " "));
        System.out.println("\n====================");

        Stream<String> concat = Stream.concat(list.stream(), list2.stream());
        //concat.forEach(s -> System.out.print(s + " "));
        System.out.println("\n====================");
        concat.distinct().forEach(s -> System.out.print(s + " "));






    }
}
